package com.mmd.admin.model.pojo.request;

import com.mmd.base.annotation.valid.group.ValidGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@Data
@ApiModel("管理员新增编辑参数")
public class AdminAddOrEditParam {

    @NotNull(message = "请选择要编辑的对象",groups = {ValidGroup.Update.class})
    @ApiModelProperty(value = "管理员id 新增不穿 编辑穿")
    private Long adminId;

    @NotNull(message = "请选择角色",groups = {ValidGroup.Update.class, ValidGroup.Insert.class})
    @Min(value = 1,message = "请选择角色",groups = {ValidGroup.Update.class, ValidGroup.Insert.class})
    @ApiModelProperty("角色")
    private Long roleId;

    @NotBlank(message = "昵称不可为空",groups = {ValidGroup.Update.class, ValidGroup.Insert.class})
    @Size(max = 20,message = "昵称最多20位",groups = {ValidGroup.Update.class, ValidGroup.Insert.class})
    @ApiModelProperty(value = "昵称")
    private String name;

    @NotBlank(message = "用户名不可为空",groups = {ValidGroup.Insert.class})
    @Size(min = 6,max = 12,message = "请输入6-12位用户名",groups = {ValidGroup.Insert.class})
    @ApiModelProperty(value = "用户名 无法编辑")
    private String username;

    @NotBlank(message = "密码不可为空",groups = {ValidGroup.Insert.class})
    @Size(min = 8,max = 16,message = "请输入8-16位密码",groups = {ValidGroup.Insert.class})
    @ApiModelProperty(value = "管理员密码")
    private String password = "";
}
